package com.company.cloud.product.modules.task.job;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.company.cloud.product.modules.base.entity.ProductInfo;
import com.company.cloud.product.modules.base.service.ProductInfoService;
//import com.xxl.job.core.biz.model.ReturnT;
//import com.xxl.job.core.handler.annotation.XxlJob;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Component
public class PrdJobHandler {
	
	private static Logger logger = LoggerFactory.getLogger(PrdJobHandler.class);
	
	@Autowired
	private ProductInfoService productInfoService;

	/**
	 * 商品排序规则更新
	 * */
//	 @XxlJob("prdOrdersUpdateHandler")
//	public ReturnT<String> prdOrdersUpdateHandler(String param){
//		logger.debug("++++ 商品排序规则更新Job : 参数 = "+param);
////		boolean flag= productInfoService.update(new UpdateWrapper<ProductInfo>()
////				.setSql("orders=FLOOR(RAND() * 10000)")
////				.le("orders", 10001)
////				);
////		// XxlJobLogger.log("商品排序规则更新,SQL执行状态:{}", flag);
//
//
//
//
//
//
////		UPDATE prd_product_info set orders=1 where orders<=1000000
////
////				UPDATE prd_product_info a, (
////				SELECT rel_id ,count(1) as n from uba_user_browse_obj_log where rel_id_type ='50'  GROUP BY rel_id
////				) b set a.orders=b.n where a.product_no=b.rel_id
//
//		return ReturnT.SUCCESS;
//	}

}
